package xiancheng.demo02;

/**
 * @author Mr.ma
 * @since 2022/10/31 13:55
 **/
public class Test02 {
    public static void main(String[] args) {
        TestRunnable tack = new TestRunnable();
        Thread testRunnable = new Thread(tack);
        testRunnable.start();
        Thread.currentThread().setName("主线程");
        for (int i = 0; i < 200; i++) {
            System.out.println(Thread.currentThread().getName() + " ============= " + i);
        }
    }
}
class TestRunnable implements Runnable{
    @Override
    public void run() {
        Thread.currentThread().setName("testRunnable");
        for (int i = 0; i < 20; i++) {
            System.out.println(Thread.currentThread().getName() + "========" + i);
        }
    }
}
